{% extends "base_logged.html" %}

{% block content %}
<ta1>Your Dmails List</ta1>

{% if latest_dmail_list %}
    <ul>
    <table border="1">
	<td><b>Date</b></td><td><b>Time</b></td><b><td><b>To</b></td><td><b>Subject</b></td><td><b>Sent</b></td><td><b>Edit</b></td><td><b>Delete</b></td></b>
    {% for ele in latest_dmail_list %}
    <tr>
      <td> {{ ele.date }}</td><td> {{ ele.time }}</td><td> {{ ele.receiver }}</td><td> {{ ele.subject }}</td><td> {{ ele.sent }}</td><td><a href="new?id={{ ele.id }}">Edit</a></td>
      <td><a href="javascript:confirmDelete('erase?id={{ ele.id }}')">Delete</a></td>
    </tr>
    {% endfor %}
    </table>
    </ul>
{% else %}
    <p>No Dmails are available.</p>
{% endif %}

<script>
  function confirmDelete(delUrl) {
  if (confirm("Are you sure you want to delete?")) {
  document.location = delUrl;
  }
}
</script>

{% endblock %}

